package com.itheima.shiro.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.shiro.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author kayak
* @description 针对表【user】的数据库操作Mapper
* @createDate 2024-06-18 14:24:25
* @Entity com.itheima.shiro.entity.User
*/
@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Select("select name from role where id in (select rid from user_role where uid = (select id from user where name = #{principal}))")
    List<String> getUserRoleInfoMapper(@Param("principal") String principal);

    List<String> getUserPermissionsInfoMapper(@Param("roles")List<String> roles);
}




